package com.xunyin.modules.mtjoin.rest;

import com.xunyin.api.ApiResult;
import com.xunyin.modules.log.AppLog;
import com.xunyin.modules.mtjoin.domain.MtJoin;
import com.xunyin.modules.mtjoin.service.MtJoinService;
import com.xunyin.modules.mtjoin.service.mapper.MtJoinMapper;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * 招商加盟类controller
 * <p>
 * Created by xunyin
 * CopyRight 讯音云商 https://www.tonetn.com
 */
@Slf4j
@RestController
@Api(value = "共享空间:招商加盟", tags = "共享空间:招商加盟")
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class ClientMtJoinController {

    private final MtJoinMapper mtJoinMapper;

    private final MtJoinService mtJoinService;

    /**
     * 招商加盟接口
     *
     * @return ApiResult<String>
     */
    @AppLog(value = "招商加盟接口", type = 1)
    //@AuthCheck
    @PostMapping("/mtJoin")
    @ApiOperation(value = "招商加盟接口", notes = "招商加盟接口")
    public ApiResult<String> mtJoin(HttpServletRequest request, @RequestBody MtJoin mtJoin) {
        mtJoinService.save(mtJoin);
        return ApiResult.ok("提交成功");
    }
}
